import fetch from '@/utils/fetch';

// 说明：添加手工抄表
// 接口：api/cb/flManualReading
// 请求类型：Post
export function addFlManualReading(obj) {
  return fetch({
      url: 'api/cb/flManualReading',
      method: 'post',
      data: obj
  });
}

// 说明：录入读数
// 接口：api/cb/flManualReading/{id}
// 请求类型：post
export function inputReadNum(id,readNum) {
  return fetch({
      url: `api/cb/flManualReading/inputReadNum?id=${id}&readNum=${readNum}`,
      method: 'post'
  })
}
// 说明：抄表机抄表分页查询(条件搜索)
// 接口：api/cb/flManualReading/search/{page}/{size}
// 请求类型：Post

export function searchFlManualReading(page, size, obj) {
    return fetch({
        url: 'api/cb/flManualReading/search3/'+ page +'/'+ size,
        method: 'post',
        data: obj
    });
}

// 说明：获取单个抄表机抄表
// 接口：api/cb/flManualReading/{id}
// 请求类型：get
export function getFlManualReading(id) {
    return fetch({
        url: 'api/cb/flManualReading/' + id,
        method: 'get'
    })
}

// 导出Xlsx
export function exprotXls(ids, obj) {
  return fetch({
  url: 'api/cb/flManualReading/exprotXlsBC/' + ids,
  responseType: 'blob',
  method: 'post',
  data: obj
  })
  }
// 导入Xlsx
export function importXls(obj) {
  return fetch({
    url: 'api/cb/flManualReading/importXls',
    method: 'post',
    data: obj
  });
}
// 下载模板
export function downTem() {
  return fetch({
    url: 'api/cb/flManualReading/exprotExcelModelBC',
    responseType: 'blob',
    // responseType: 'arraybuffer',
    method: 'get'
  });
}
